<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      canvas {
        border: 1px solid #ccc;
        margin-right:5px;
      }
    </style>
  </head>
  <body>

    <video src="../imgs/01.mp4" controls width="400" height="400" muted  ></video>

    <script>
      (() => {
        const canvas = document.createElement("canvas");
        canvas.width = 400;
        canvas.height = 400;
        document.body.append(canvas);

        const ctx = canvas.getContext('2d');
        
        const video = document.querySelector('video');
        video.addEventListener('play',function(){
          draw();
        })



        ctx.arc(200,200,150,0,Math.PI*2);
        //ctx.filter = "blur(5px)";
        ctx.filter = 'invert(0.8)';
        ctx.clip();
        function draw(){
          ctx.clearRect(0,0,400,400);
          ctx.drawImage(video,0,0,400,400);
          requestAnimationFrame(draw);
        }

      })();
      


      
    </script>
  </body>
</html>
